package com.btpj.oauth2.entity;

import lombok.Data;

@Data
public class RespBean {

    private int status;
    private String msg;
    private Object data;

    public static RespBean success(Object data, String msg) {
        RespBean respBean = new RespBean();
        respBean.status = 0;
        respBean.msg = msg;
        respBean.data = data;
        return respBean;
    }

    public static RespBean success(Object data) {
        return RespBean.success(data, "请求成功");
    }

    public static RespBean success(String msg) {
        return RespBean.success(null, msg);
    }

    public static RespBean error(String msg) {
        RespBean respBean = new RespBean();
        respBean.status = 1;
        respBean.msg = msg;
        return respBean;
    }
}
